package me.dqn.noway.bean;

public class PasswordUser {
    private int id;

    private String username;

    // 解密key的hash
    private String decryptKey;

    private String salt;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getDecryptKey() {
        return decryptKey;
    }

    public void setDecryptKey(String decryptKey) {
        this.decryptKey = decryptKey;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    @Override
    public String toString() {
        return "PasswordUser{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", decryptKey='" + decryptKey + '\'' +
                ", salt='" + salt + '\'' +
                '}';
    }

    public boolean validate() {
        if (username == null || username.trim().equals("")) {
            return false;
        }
        if (decryptKey == null || decryptKey.trim().equals("")) {
            return false;
        }
        return true;
    }
}
